import config from '../../assets/js/conf/config';
import {request} from '../../assets/js/utils/request';

//添加收货地址
export function addAddress(params){
    return request(config.baseUrl+'/user/address/add?token='+config.token, 'post', params);
}

//获取收货地址列表
export function getAddress(params){
    return request(config.baseUrl+'/user/address/index?uid='+params.uid+'&token='+config.token)
}

//删除收货地址
export function delAddress(params){
    return request(config.baseUrl+'/user/address/del?uid='+params.uid+
    '&aid='+params.aid+'&token='+config.token)
}

//修改收货地址
export function modAddress(params){
    return request(config.baseUrl+'/user/address/mod?token='+config.token, 'post', params);
}

//获取收货地址信息
export function getAddressInfo(params){
    return request(config.baseUrl+'/user/address/info?uid='+params.uid+
    '&aid='+params.aid+'&token='+config.token)
}

//获取默认收货地址
export function getDefaultAddress(params){
    return request(config.baseUrl+'/user/address/defaultAddress?uid='+params.uid+'&token='+config.token)
}